package sysu.el.array.ints;



public class ArrStackInt extends ArrInt implements StackIntI{

	public ArrStackInt(int num) {
		super(num);
	}
	
	@Override
	public void push(int elem){
		this.add(elem);
	}
	
	@Override
	public int pop(){
		return this.list[--counter];
	}

	@Override
	public int getNum() {
		return this.counter;
	}

	@Override
	public boolean isEmpty() {
		return counter == 0;
	}
	
	public boolean isFull(){
		return counter == this.list.length;
	}

	@Override
	public int top() {
		return this.list[counter-1];
	}
	
	public void setTop(int elem){
		this.list[this.counter-1] = elem;
	}

}
